package com.siyuan.sns.dao.impl;

import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.siyuan.sns.dao.ExampleDao;
import com.siyuan.sns.domain.entity.ExampleEntity;
import com.siyuan.sns.utils.dao.BaseDao;

@Repository("adminDao")
public class ExampleDaoImpl extends BaseDao implements ExampleDao {

	@Override
	public ExampleEntity findByUsername(String username) {
		Session session = this.getSession();
		return (ExampleEntity) session.createCriteria(ExampleEntity.class)
				.add(Restrictions.eq("username", username)).uniqueResult();
	}

}
